package com.smritimap.demo.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;

import com.smritimap.demo.R;
import com.timestar.step.HorizontalStepView;
import com.timestar.step.bean.StepBean;

import java.util.ArrayList;
import java.util.List;

/**
 * memory_create_step、MemoryCreateStepFrag、
 */
public class MemoryCreateStepFrag extends Fragment {

    public static MemoryCreateStepFrag newInstance() {
        return new MemoryCreateStepFrag();
    }

    View mView;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        mView = View.inflate(container.getContext(), R.layout.fragment_memory_create_step, null);
        showCreateMemoryStepView();
        return mView;
    }

    private void showCreateMemoryStepView() {
        HorizontalStepView memoryStepView
                = mView.findViewById(R.id.memoryStepView);
        List<StepBean> stepsBeanList = new ArrayList<>();
        StepBean stepBean0 = new StepBean("创建主题\n" +
                "时光路书", 1);
        StepBean stepBean1 = new StepBean("编辑\n" +
                "主题模版", 0);
        StepBean stepBean2 = new StepBean("完成\n" +
                "时光路书", -1);
        stepsBeanList.add(stepBean0);
        stepsBeanList.add(stepBean1);
        stepsBeanList.add(stepBean2);
        memoryStepView.setStepViewTexts(stepsBeanList)
                .setTextSize(12)
                .setCompletedLineColor(Color.parseColor("#8019FFEB"))
                .setUnCompletedLineColor(Color.parseColor("#8019FFEB"))
                .setComplectedTextColor(Color.parseColor("#8019E8FF"))
                .setUnComplectedTextColor(Color.parseColor("#19E8FF"))
                .setCompleteIcon(ContextCompat.getDrawable(getActivity(), R.mipmap.ic_memory_create_complete))
                .setDefaultIcon(ContextCompat.getDrawable(getActivity(), R.mipmap.ic_memory_create_un_complete))
                .setAttentionIcon(ContextCompat.getDrawable(getActivity(), R.mipmap.ic_memory_create_attention));
    }

}
